//
//  AddNewCardView.m
//  YTwallet
//
//  Created by ZhangLin on 2019/3/12.
//  Copyright © 2019年 hadrlog. All rights reserved.
//

#import "AddNewCardView.h"
#import <Masonry.h>
@implementation AddNewCardView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setupViews];
    }
    return self;
}

-(void)setupViews{
    self.backgroundColor = [UIColor whiteColor];
    
    self.addCardBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.addCardBtn setImage:[UIImage imageNamed:@"card_icon_line"] forState:(UIControlStateNormal)];
    [self.addCardBtn setImage:[UIImage imageNamed:@"card_icon_line"] forState:(UIControlStateHighlighted)];
    [self addSubview:self.addCardBtn];
    [self.addCardBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.right.mas_equalTo(-20);
//        make.centerY.equalTo(self);
        make.bottom.equalTo(self);
        make.height.mas_equalTo(54);
    }];
    
    
    self.addCardImv = [[UIImageView alloc] init];
    self.addCardImv.image = [UIImage imageNamed:@"nav_icon_arrow_left"];
    [self.addCardBtn addSubview:self.addCardImv];
    [self.addCardImv mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.addCardBtn);
        make.centerX.equalTo(self).offset(-30);
        make.width.mas_equalTo(22);
        make.height.mas_equalTo(22);
    }];
    
    self.addTipsLab = [[UILabel alloc] init];
    self.addTipsLab.text = @"添加新卡";
    self.addTipsLab.font = [UIFont systemFontOfSize:16];
    self.addTipsLab.textColor = [UIColor colorWithRed:51 / 255.0 green:51 / 255.0 blue:51 / 255.0 alpha:1];
    [self.addCardBtn addSubview:self.addTipsLab];
    [self.addTipsLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.addCardImv.mas_right);
        make.centerY.equalTo(self.addCardBtn);
    }];
    
    
    
    
}

@end
